import request from '@/utils/request'

// 查询新闻列表
export function listElect(query) {
  return request({
    url: '/elect/list',
    method: 'get',
    params: query
  })
}

// 查询新闻详细
export function getElect(electId) {
  return request({
    url: '/elect/' + electId,
    method: 'get'
  })
}

// 新增新闻
export function addElect(data) {
  return request({
    url: '/elect',
    method: 'post',
    data: data
  })
}

// 修改新闻
export function updateElect(data) {
  return request({
    url: '/elect',
    method: 'put',
    data: data
  })
}

// 删除新闻
export function delElect(electId) {
  return request({
    url: '/elect/' + electId,
    method: 'delete'
  })
}

